import request from '@/utils/request'
export function queryPage(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/classifyInfo/getClassifyTree',
    method: 'post',
    data
  })
}

export function insert(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/classifyInfo/insert',
    method: 'post',
    data
  })
}

export function get(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/classifyInfo/get',
    method: 'post',
    data
  })
}

export function update(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/classifyInfo/update',
    method: 'post',
    data
  })
}

export function del(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/classifyInfo/deleteById',
    method: 'post',
    data
  })
}

// 切换状态
export function updateStatus(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/classifyInfo/updateStatus',
    method: 'post',
    data
  })
}
/**
 * 查询字典项
 */
export function getDictByCode(dictCode) {
  return request({
    baseURL: '/API-APP/',
    url: '/app/sysDictionary/getDictByCode',
    method: 'get',
    params: { dictCode }
  })
}
// 分类的标签列表
export function getLabelsList(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/labelClassify/queryByLabelId',
    method: 'post',
    data
  })
}
// 移动
export function move(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/classifyInfo/moveSort',
    method: 'post',
    data
  })
}
// 分类新增标签
export function addlabels(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/labelClassify/insertLabel',
    method: 'post',
    data
  })
}
